'use strict';

var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

var _class;

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _radium = require('radium');

var _radium2 = _interopRequireDefault(_radium);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }

function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }

var CSComponent = (0, _radium2.default)(_class = function (_React$Component) {
  _inherits(CSComponent, _React$Component);

  function CSComponent(props) {
    _classCallCheck(this, CSComponent);

    var _this = _possibleConstructorReturn(this, (CSComponent.__proto__ || Object.getPrototypeOf(CSComponent)).call(this, props));

    _this.showPhone = _this.showPhone.bind(_this);
    _this.hidePhone = _this.hidePhone.bind(_this);
    _this.showWeixin = _this.showWeixin.bind(_this);
    _this.hideWeixin = _this.hideWeixin.bind(_this);
    _this.stopP = _this.stopP.bind(_this);

    _this.state = {};
    return _this;
  }

  _createClass(CSComponent, [{
    key: 'showPhone',
    value: function showPhone() {
      this.setState({ isShowPhone: true });
    }
  }, {
    key: 'hidePhone',
    value: function hidePhone() {
      this.setState({ isShowPhone: false });
    }
  }, {
    key: 'showWeixin',
    value: function showWeixin() {
      this.setState({ isShowWeixin: true });
    }
  }, {
    key: 'hideWeixin',
    value: function hideWeixin() {
      this.setState({ isShowWeixin: false });
    }
  }, {
    key: 'stopP',
    value: function stopP(e) {
      e.stopPropagation();
    }
  }, {
    key: 'render',
    value: function render() {
      return _react2.default.createElement(
        'div',
        { style: { position: 'fixed', bottom: '0px', right: '0px', width: '80px', textAlign: 'center', lineHeight: '80px', color: '#fff', backgroundColor: '#6495ed', fontSize: '24px' } },
        _react2.default.createElement(
          'div',
          { style: { lineHeight: '45px', backgroundColor: '#8a2be2', fontSize: '14px' } },
          '\u5BA2\u670D\u4E2D\u5FC3'
        ),
        _react2.default.createElement(
          'div',
          { key: 'phone', onClick: this.showPhone, style: { cursor: 'pointer', opacity: '0.6', ':hover': { opacity: '1' } } },
          _react2.default.createElement('i', { className: 'fa fa-phone' })
        ),
        _react2.default.createElement(
          'a',
          { key: 'qq', target: '_blank', href: 'http://wpa.qq.com/msgrd?v=3&uin=1958851403&site=qq&menu=yes', style: { color: '#FFF', borderTop: '1px solid #e6e6e6', display: 'block', opacity: '0.6', ':hover': { opacity: '1' } } },
          _react2.default.createElement('i', { className: 'fa fa-qq' })
        ),
        _react2.default.createElement(
          'div',
          { key: 'weixin', onClick: this.showWeixin, style: { borderTop: '1px solid #e6e6e6', cursor: 'pointer', opacity: '0.6', ':hover': { opacity: '1' } } },
          _react2.default.createElement('i', { className: 'fa fa-weixin' })
        ),
        !!this.state.isShowPhone ? _react2.default.createElement(
          'div',
          { style: { position: 'fixed', display: 'table', top: '0px', left: '0px', width: '100%', height: '100%', backgroundColor: 'rgba(0,0, 0, 0.8)' }, onClick: this.hidePhone },
          _react2.default.createElement(
            'div',
            { style: { display: 'table-cell', width: '100%', height: '100%', textAlign: 'center', verticalAlign: 'middle' } },
            _react2.default.createElement(
              'span',
              { style: { padding: '40px 20px 0px', minWidth: '300px', lineHeight: '40px', display: 'inline-block', maxWidth: '100%', backgroundColor: '#5F9EA0', height: '120px', color: '#fff', border: '1px solid #DEB887' }, onClick: this.stopP },
              _react2.default.createElement('i', { className: 'fa fa-phone', style: { marginRight: '10px' } }),
              '17718408376'
            )
          )
        ) : null,
        !!this.state.isShowWeixin ? _react2.default.createElement(
          'div',
          { style: { position: 'fixed', display: 'table', top: '0px', left: '0px', width: '100%', height: '100%', backgroundColor: 'rgba(0,0, 0, 0.8)' }, onClick: this.hideWeixin },
          _react2.default.createElement(
            'div',
            { style: { display: 'table-cell', width: '100%', height: '100%', textAlign: 'center', verticalAlign: 'middle' } },
            _react2.default.createElement(
              'div',
              { style: { display: 'inline-block' } },
              _react2.default.createElement('img', { src: '/img/weixin.png', style: { width: '200px' } }),
              _react2.default.createElement(
                'div',
                { style: { lineHeight: '45px', fontSize: '16px' } },
                '\u5FAE\u4FE1\u626B\u4E00\u626B'
              )
            )
          )
        ) : null
      );
    }
  }]);

  return CSComponent;
}(_react2.default.Component)) || _class;

;

module.exports = CSComponent;